package com.baojiaren;

import com.netflix.loadbalancer.RandomRule;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
/**
 * @author ✎ℳ๓₯㎕.倾心❀、
 * @create 2021-07-15-9:34
 */
@SpringBootApplication
public class ServiceConsumerApplication {

    @Bean
    public RandomRule randomRule(){
       return new RandomRule();
    }
    @Bean
    //@LoadBalanced //负载均衡注解
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

    public static void main(String[] args) {
        SpringApplication.run(ServiceConsumerApplication.class);
    }
}
